// 1.仓库内容
const store = {
  namespaced: true,
  state: {
    cancelTokenArr: []
  },
  mutations: {
    cancelToken (state) {
      // console.log(state.cancelTokenArr)
      state.cancelTokenArr.forEach((item) => {
        // console.log(item)
        // item()
      })
      state.cancelTokenArr = []
    },
    // 添加cancel的方法
    pushToken (state, payload) {
      // console.log('====', payload)
      state.cancelTokenArr.push(payload.cancelToken)
    },
    // 删除cancel的方法
    clearToken (state) {
      state.cancelTokenArr = []
    }
  }
}
export default store
